load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "udsipc",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "lib": {"name": "udsipc"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-udsipc",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    crate_root = "src/lib.rs",
    os_deps = [
        (
            "windows",
            [
                "fbsource//third-party/rust:uds_windows",
            ],
        ),
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:fn-error-context",
        "fbsource//third-party/rust:fs-err",
        "//eden/scm/lib/util/nodeipc:nodeipc",
    ],
)
